<?php
/* @var $this SiteController */
$this->layout = '//layouts/column2';
Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/assets/theme_a/js/pages/product.category.js', CClientScript::POS_END);
$active = array();
$breadcrumb = array();
if(!empty($categories)) {
    foreach($categories as $category){
        $active[] = $category['MENU_CODE'];
        if ($category != end($categories)){
            $breadcrumb[$category['MENU_NAME']] = array('category/index', 'catSlug'=> $category['MENU_SLUG']);
        }else{
            $breadcrumb[] = $category['MENU_NAME'];
            $this->pageTitle =  Yii::t("messages", Yii::app()->name)  . ' - '. $category['MENU_NAME'];
        }
    }
}
$this->categories = $active;
$this->breadcrumbs = $breadcrumb;

?>


<h1><?php $array = end($categories); echo $array['MENU_NAME'] ?></h1>
<div class="product-filter">
    <div class="display"><b><?php echo Yii::t("messages", "Display") ?> :</b>
        <a data-layout="grid" class="grid-icon" title="<?php echo Yii::t("messages", "Grid") ?>"><?php echo Yii::t("messages", "Grid") ?></a>
        <a data-layout="list" class="list-icon active" title="<?php echo Yii::t("messages", "List") ?>"><?php echo Yii::t("messages", "Grid") ?></a>
    </div>
    <div class="sort"><b><?php echo Yii::t("messages", "Sort By") ?> :</b>
        <select id="sortOrder" name="SORT_ORDER">
            <option value="1" selected="selected"><?php echo Yii::t("messages", 'Product Name')." (A - Z)" ?></option>
            <option value="2" ><?php echo Yii::t("messages", 'Product Name')." (Z - A)" ?></option>
        </select>
    </div>
</div>
<div id="product-update" class="product-list product-layout">
<?php $this->renderPartial('products', array("products"=> $products)); ?>

</div>

